package com.controller;

import com.entity.User;
import com.entity.movie;
import com.service.serviceclass.UserServiceImp;
import com.service.serviceclass.movieServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@CrossOrigin
public class movieController {
    @Autowired
    private movieServiceImp movieServiceImp;
    @RequestMapping("/getMovieList")
    public List<movie> getMovieList(){
        List<movie> list = movieServiceImp.getMovieList();
        return list;
    }
    @RequestMapping("/getMovieById")
    public movie getMovieByid(@RequestParam String id){
        movie movie = movieServiceImp.getMovieById(id);
        return movie;
    }
}
